<template>
	<view class="pages">
		<view class="page-view">
			<view class="class-item">
				<view class="item-container">
					<view class="checkCity">
						<view class="city-box" v-for="(item1, index1) in tabbarData['city']" :key="index1">
							<view class="city-box-title">
								{{item1.c_name?item1.c_name:item1.p_name}}
							</view>
							<view class="cityList">
								<view class="cityItem" v-for="(item2, index2) in item1['qu']" @click="postStep(item1,item2)">
									{{item2.c_name}}
								</view>

							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		getJigou
	} from 'api/api.js';
	export default {

		data() {
			return {
				tabbarData: []
			}
		},
		onLoad() {
			this.getForumList()
		},
		methods: {
			postStep(city,qu){
				 let pages = getCurrentPages();
				 let prevPage = pages[pages.length - 2];
				 prevPage.$vm.backChaosongPage({ 
				 	city: city,
				 	qu:qu
				 })
				 uni.navigateBack();
			},
			getForumList() {
				let _this = this
				getJigou({}).then(r => {
					if (r.data.code == 200) {
						_this.tabbarData = r.data.data
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>

.checkCity{
		.city-box{
			border-bottom:2rpx solid #eee;
			padding:30rpx;
			&-title{
				color:#999;
				font-size:34rpx;
				margin-bottom:20rpx;
			}
			.cityList{
				display: flex;
				flex-wrap: wrap;
				.cityItem{
					width:48%;
					margin:20rpx 1%;
				}
			}
		}
	}
</style>